5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
- Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
+ Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 2-4: Files and Fields

Special Uses for Synonym Fields


Because synonym fields permit you to access data in physical fields with alternative field names and sequence numbers, they provide additional capabilities. These capabilities include such things as resequencing key numbers to match those assigned by non-APPX databases, creating noncontiguous or overlapping group fields, and providing an alternative key order for online data retrieval.

Resequencing key numbers

The APPX dictionary permits you to establish one primary key and up to 16 alternate keys to a file. APPX automatically assigns key number 0 to a primary key when the data dictionary is processed. Alternate keys are assigned key numbers based upon their position in a record (their sequence number). The alternate key field with the lowest sequence number is key number 1, the alternate key field with the next lowest sequence number is key number 2, and so on. You cannot change the assigned key numbers. If you subsequently modify the sequence numbers of key fields, the assigned key numbers are not changed.

If an APPX data dictionary is created for an application that was developed in another third or fourth generation language, the APPX-assigned key numbers may not match the key numbers that were assigned during development. Synonym fields can be used to resequence key number assignments, forcing a match between APPX's key numbers and the key numbers that were assigned by the development software.

Creating noncontiguous groups

A group field in APPX must be comprised of fields with contiguous sequence numbers. You cannot include a field with a noncontiguous sequence number in a group field.

If for any reason you cannot change the sequence number of a noncontiguous field to satisfy this requirement, you can use a synonym field. Simply define a synonym for the noncontiguous field, and assign the synonym a sequence number that falls between the sequence number of the group header field and group trailer field. The synonym automatically becomes part of the group.

A synonym field occupies the same physical space and accesses the same data as the (noncontiguous) field it references. A synonym?s sequence number, however, is contiguous with that of other fields in the group, satisfying the group requirement.

Creating overlapping group fields

A group field cannot incorporate a field that is part of another group unless it incorporates all fields from the other group. In other words, groups can be nested but they cannot overlap.

You can circumvent this restriction by defining a synonym for a field that participates in more than one group. For example, suppose you create group A, which includes a customer number and an invoice number field. You wish to define group B, which also includes the customer number. You must first define a synonym of the customer number, and include the synonym field in group B.

A synonym field occupies the same physical space and accesses the same data as the field it references. However, because APPX considers the synonym to be a separate field, group A and group B do not share a common field and are therefore not considered as overlapping.

Providing an alternative key order for online retrieval

Many times, a group is designated as a key, solely to establish an order or sequence for online data retrieval. Under some circumstances, however, it may be necessary to provide for online retrieval of the same information by the same fields, but in different orders. (Remember that the retrieval order is deermined by the relative sequence numbers of fields within a group, and the ascending/descending specifications for those fields.)

Take, for example, a history file that contains a customer number and an annual activity amount for each customer. In one instance, you may wish to retrieve records based on customer activity, sequenced in descending order, from highest-volume customer to lowest. In another, you may wish to reverse the sequence. To provide for online retrieval in both an ascending and descending sequence, you need a synonym field.

Now, assume your application includes a Products by Customer file that identifies the range of products each customer is authorized to purchase. In one instance, you are required to retrieve, in product number order, all the products a specific customer is authorized to buy. Such an operation requires a group field key consisting of customer number and product number, in that order. In another instance, your user needs to retrieve all the customers who are authorized to buy a specific product. This operation requires a group field key consisting of product number and customer number, in that order. To establish this second key, incorporating the same fields as the first key but in a different sequence, you must first create synonyms of the customer number and product number fields. For these synonym fields, the customer synonym's sequence number must be larger than that of the product synonym.

Application Design Manual                                         "Powered by Appx Software"

213

©2006 By APPX Software, Inc. All Rights Reserved